package main

import (
	"encoding/json"
	"fmt"
)

type test struct {
	Data []struct {
		I int    `json:"i"`
		S string `json:"s"`
	} `json:"data"`
}

func (t test) String() string {
	ba, _ := json.Marshal(t)
	return string(ba)
}

func main() {
	t := &test{
		Data: []struct {
			I int    `json:"i"`
			S string `json:"s"`
		}{
			{2, "test"},
			{3, "t"},
		},
	}
	t.Data = append(t.Data, struct {
		I int    `json:"i"`
		S string `json:"s"`
	}{1, "testing"})
	fmt.Printf("%v\n", t)
}
